import requests

ip="http://192.168.222.140"
#登录
logindata={"username":"123456","password":"123456","act":"act_login","back_act":"http://192.168.222.140/index.php","submit":""}
c1=requests.post(f"{ip}/user.php",data=logindata)
# 提取cookise
r=c1.cookies
#新增留言
#上传文件
FData2={'message_img':
('32.png',
open(r'F:\work\codings\python\2504\pythonjieko\datas\32.png','rb'),
'image/png')}
liuyandata={"msg_type":0,"msg_title":"热","msg_content":"大热天","message_img":"","act":"act_add_message"}
c2=requests.post(f"{ip}/user.php",data=liuyandata,cookies=r,files=FData2)
print(c2.text)
#删除留言
sahnchudata={"act":"del_msg","id":32,"order_id":0}
